//
//  DSRefreshHeaderView.h
//  zzzz
//
//  Created by rainday on 15/1/24.
//  Copyright (c) 2015年 rainday. All rights reserved.
//
#import <UIKit/UIKit.h>

typedef enum : NSUInteger {
    DSRefreshHeaderViewStateNormal=0,
    DSRefreshHeaderViewStatePulling,
    DSRefreshHeaderViewStateLoading,
} DSRefreshHeaderViewState;


@protocol DSRefreshHeaderViewDelegate;

@interface DSRefreshHeaderView : UIView{
    DSRefreshHeaderViewState _state;
    
    UILabel *_lastUpdatedLabel;
    UILabel *_statusLabel;
    CALayer *_arrowImage;
    UIActivityIndicatorView *_activityView;
    
    
}

@property (nonatomic ,assign) id <DSRefreshHeaderViewDelegate>delegate;

- (void)refreshLastUpdatedDate;
- (void)dsRefreshScrollViewDidScroll:(UIScrollView *)scrollView;
- (void)dsRefreshScrollViewDidEndDragging:(UIScrollView *)scrollView;
- (void)dsRefreshScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollView;

@end


@protocol DSRefreshHeaderViewDelegate <NSObject>

- (void)dsRefreshTableHeaderDidTriggerRefesh:(DSRefreshHeaderView *)headerView;
- (BOOL)dsRefreshTableHeaderDataSourceIsLoading:(DSRefreshHeaderView *)headerView;
@optional
- (NSDate *)dsRefreshTableHeaderDataSourceLastUpdated:(DSRefreshHeaderView *)headerView;


@end



